n=int(input()) for(a,b),(c,d)in zip(s:=sorted((e,i+1)for i,e in enumerate(map(int,input().split()))),s[1:]):a==c!=print(b,d)